﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

using Lenovo.CFI.BLL.Sys;
using Lenovo.CFI.BLL;

namespace Lenovo.CFI.Web.VP
{
    public partial class HelpList : System.Web.UI.UserControl
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                SysParaBl sysParaBl = new SysParaBl();
                AttachmentBl attBl = new AttachmentBl();

                Guid? cfi = sysParaBl.GetTemplateCfi();
                if (cfi.HasValue)
                {
                    //this.HlCfi.Text = attBl.GetAttachmentByID(cfi.Value).Title;
                    this.HlCfi.NavigateUrl = AttachmentUrl.GetFileUrl(cfi.Value, true);
                }
                else
                    this.HlCfi.Visible = false;

                Guid? cs = sysParaBl.GetTemplateCSuggestion();
                if (cs.HasValue)
                {
                    //this.HlCfi.Text = attBl.GetAttachmentByID(cfi.Value).Title;
                    this.HlCs.NavigateUrl = AttachmentUrl.GetFileUrl(cs.Value, true);
                }
                else
                    this.HlCs.Visible = false;
            }
        }
    }
}